import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/views/layout'
import _import from '@/router/_import'
import {SystemRouterMaps} from '@/router/biz_router/SystemRouterMaps'
import {CmsRouterMaps} from '@/router/biz_router/CmsRouterMaps'


Vue.use(Router)

export const page401 = {
    path: '/401',
    name: '权限不足',
    component: _import('error/Page401'),
    hidden: true
};

export const page404 = {
    path: '/*',
    name: '页面不存在',
    component: _import('error/Page404'),
    hidden: true
};

export const page500 = {
    path: '/500',
    name: '服务端错误',
    component: _import('error/Page500'),
    hidden: true
};

export const loginRouter = {
    path: '/login',
    name: '登录',
    component: _import('login/index'),
    hidden: true
};

export const profileRouter = {
    path: '/profile',
    component: Layout,
    hidden: true,
    name: '个人中心',
    children: [
        {path: 'profile', name: '我的信息', component: _import('profile/index')},
        {path: 'message', name: '消息中心', component: _import('profile/MyMessage')}
    ]
}

// 公共路由
export const BaseRouters = [
    loginRouter,
    profileRouter,
    page500,
    page401
]

// 业务路由系统管理
export const SystemRouters = [...SystemRouterMaps, page404]


// 业务路由内容管理系统
export const CmsRouters = [...CmsRouterMaps, page404]


export default new Router({
    routes: BaseRouters
})